3.19 \(\int \frac{d+e x+f x^2+g x^3+h x^4+i x^5}{1+x^2+x^4} \, dx\)

Optimal. Leaf size=151 \[ -\frac{\tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right ) (d+f-2 h)}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right ) (d+f-2 h)}{2 \sqrt{3}}-\frac{1}{4} (d-f) \log \left (x^2-x+1\right )+\frac{1}{4} (d-f) \log \left (x^2+x+1\right )+\frac{\tan ^{-1}\left (\frac{2 x^2+1}{\sqrt{3}}\right ) (2 e-g-i)}{2 \sqrt{3}}+\frac{1}{4} (g-i) \log \left (x^4+x^2+1\right )+h x+\frac{i x^2}{2} \]

[Out]

h*x + (i*x^2)/2 - ((d + f - 2*h)*ArcTan[(1 - 2*x)/Sqrt[3]])/(2*Sqrt[3]) + ((d +
f - 2*h)*ArcTan[(1 + 2*x)/Sqrt[3]])/(2*Sqrt[3]) + ((2*e - g - i)*ArcTan[(1 + 2*x
^2)/Sqrt[3]])/(2*Sqrt[3]) - ((d - f)*Log[1 - x + x^2])/4 + ((d - f)*Log[1 + x +
x^2])/4 + ((g - i)*Log[1 + x^2 + x^4])/4

_______________________________________________________________________________________

Rubi [A]  time = 0.352666, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 19, number of rules used = 9, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25 \[ -\frac{\tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right ) (d+f-2 h)}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right ) (d+f-2 h)}{2 \sqrt{3}}-\frac{1}{4} (d-f) \log \left (x^2-x+1\right )+\frac{1}{4} (d-f) \log \left (x^2+x+1\right )+\frac{\tan ^{-1}\left (\frac{2 x^2+1}{\sqrt{3}}\right ) (2 e-g-i)}{2 \sqrt{3}}+\frac{1}{4} (g-i) \log \left (x^4+x^2+1\right )+h x+\frac{i x^2}{2} \]

Antiderivative was successfully verified.

[In]  Int[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(1 + x^2 + x^4),x]

[Out]

h*x + (i*x^2)/2 - ((d + f - 2*h)*ArcTan[(1 - 2*x)/Sqrt[3]])/(2*Sqrt[3]) + ((d +
f - 2*h)*ArcTan[(1 + 2*x)/Sqrt[3]])/(2*Sqrt[3]) + ((2*e - g - i)*ArcTan[(1 + 2*x
^2)/Sqrt[3]])/(2*Sqrt[3]) - ((d - f)*Log[1 - x + x^2])/4 + ((d - f)*Log[1 + x +
x^2])/4 + ((g - i)*Log[1 + x^2 + x^4])/4

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ h x - \left (\frac{d}{4} - \frac{f}{4}\right ) \log{\left (x^{2} - x + 1 \right )} + \left (\frac{d}{4} - \frac{f}{4}\right ) \log{\left (x^{2} + x + 1 \right )} + \left (\frac{g}{4} - \frac{i}{4}\right ) \log{\left (x^{4} + x^{2} + 1 \right )} + \frac{\sqrt{3} \left (d + f - 2 h\right ) \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x}{3} - \frac{1}{3}\right ) \right )}}{6} + \frac{\sqrt{3} \left (d + f - 2 h\right ) \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x}{3} + \frac{1}{3}\right ) \right )}}{6} + \frac{\sqrt{3} \left (2 e - g - i\right ) \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x^{2}}{3} + \frac{1}{3}\right ) \right )}}{6} + \frac{\int ^{x^{2}} i\, dx}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4+x**2+1),x)

[Out]

h*x - (d/4 - f/4)*log(x**2 - x + 1) + (d/4 - f/4)*log(x**2 + x + 1) + (g/4 - i/4
)*log(x**4 + x**2 + 1) + sqrt(3)*(d + f - 2*h)*atan(sqrt(3)*(2*x/3 - 1/3))/6 + s
qrt(3)*(d + f - 2*h)*atan(sqrt(3)*(2*x/3 + 1/3))/6 + sqrt(3)*(2*e - g - i)*atan(
sqrt(3)*(2*x**2/3 + 1/3))/6 + Integral(i, (x, x**2))/2

_______________________________________________________________________________________

Mathematica [C]  time = 1.44361, size = 187, normalized size = 1.24 \[ \frac{1}{12} \left (\left (1+i \sqrt{3}\right ) \tan ^{-1}\left (\frac{1}{2} \left (\sqrt{3}-i\right ) x\right ) \left (2 \sqrt{3} d-\left (\sqrt{3}+3 i\right ) f-\left (\sqrt{3}-3 i\right ) h\right )+\left (\sqrt{3}+i\right ) \tan ^{-1}\left (\frac{1}{2} \left (\sqrt{3}+i\right ) x\right ) \left (-2 i \sqrt{3} d+\left (3+i \sqrt{3}\right ) f+i \left (\sqrt{3}+3 i\right ) h\right )-2 \sqrt{3} \tan ^{-1}\left (\frac{\sqrt{3}}{2 x^2+1}\right ) (2 e-g-i)+3 (g-i) \log \left (x^4+x^2+1\right )+6 x (2 h+i x)\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(1 + x^2 + x^4),x]

[Out]

(6*x*(2*h + i*x) + (1 + I*Sqrt[3])*(2*Sqrt[3]*d - (3*I + Sqrt[3])*f - (-3*I + Sq
rt[3])*h)*ArcTan[((-I + Sqrt[3])*x)/2] + (I + Sqrt[3])*((-2*I)*Sqrt[3]*d + (3 +
I*Sqrt[3])*f + I*(3*I + Sqrt[3])*h)*ArcTan[((I + Sqrt[3])*x)/2] - 2*Sqrt[3]*(2*e
 - g - i)*ArcTan[Sqrt[3]/(1 + 2*x^2)] + 3*(g - i)*Log[1 + x^2 + x^4])/12

_______________________________________________________________________________________

Maple [B]  time = 0.011, size = 303, normalized size = 2. \[{\frac{i{x}^{2}}{2}}+hx+{\frac{d\ln \left ({x}^{2}+x+1 \right ) }{4}}-{\frac{\ln \left ({x}^{2}+x+1 \right ) f}{4}}+{\frac{\ln \left ({x}^{2}+x+1 \right ) g}{4}}-{\frac{\ln \left ({x}^{2}+x+1 \right ) i}{4}}+{\frac{d\sqrt{3}}{6}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{\sqrt{3}e}{3}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}f}{6}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}g}{6}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{\sqrt{3}h}{3}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}i}{6}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }+{\frac{\ln \left ({x}^{2}-x+1 \right ) g}{4}}-{\frac{\ln \left ({x}^{2}-x+1 \right ) i}{4}}+{\frac{\ln \left ({x}^{2}-x+1 \right ) f}{4}}-{\frac{d\ln \left ({x}^{2}-x+1 \right ) }{4}}+{\frac{d\sqrt{3}}{6}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}e}{3}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{\sqrt{3}f}{6}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }-{\frac{\sqrt{3}g}{6}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }-{\frac{\sqrt{3}h}{3}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }-{\frac{\sqrt{3}i}{6}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4+x^2+1),x)

[Out]

1/2*i*x^2+h*x+1/4*d*ln(x^2+x+1)-1/4*ln(x^2+x+1)*f+1/4*ln(x^2+x+1)*g-1/4*ln(x^2+x
+1)*i+1/6*d*arctan(1/3*(1+2*x)*3^(1/2))*3^(1/2)-1/3*3^(1/2)*arctan(1/3*(1+2*x)*3
^(1/2))*e+1/6*3^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*f+1/6*3^(1/2)*arctan(1/3*(1+2*
x)*3^(1/2))*g-1/3*3^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*h+1/6*3^(1/2)*arctan(1/3*(
1+2*x)*3^(1/2))*i+1/4*ln(x^2-x+1)*g-1/4*ln(x^2-x+1)*i+1/4*ln(x^2-x+1)*f-1/4*d*ln
(x^2-x+1)+1/6*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*d+1/3*3^(1/2)*arctan(1/3*(2*x-
1)*3^(1/2))*e+1/6*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*f-1/6*3^(1/2)*arctan(1/3*(
2*x-1)*3^(1/2))*g-1/3*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*h-1/6*3^(1/2)*arctan(1
/3*(2*x-1)*3^(1/2))*i

_______________________________________________________________________________________

Maxima [A]  time = 0.795338, size = 143, normalized size = 0.95 \[ \frac{1}{2} \, i x^{2} + \frac{1}{6} \, \sqrt{3}{\left (d - 2 \, e + f + g - 2 \, h + i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{1}{6} \, \sqrt{3}{\left (d + 2 \, e + f - g - 2 \, h - i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + h x + \frac{1}{4} \,{\left (d - f + g - i\right )} \log \left (x^{2} + x + 1\right ) - \frac{1}{4} \,{\left (d - f - g + i\right )} \log \left (x^{2} - x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 + x^2 + 1),x, algorithm="maxima")

[Out]

1/2*i*x^2 + 1/6*sqrt(3)*(d - 2*e + f + g - 2*h + i)*arctan(1/3*sqrt(3)*(2*x + 1)
) + 1/6*sqrt(3)*(d + 2*e + f - g - 2*h - i)*arctan(1/3*sqrt(3)*(2*x - 1)) + h*x
+ 1/4*(d - f + g - i)*log(x^2 + x + 1) - 1/4*(d - f - g + i)*log(x^2 - x + 1)

_______________________________________________________________________________________

Fricas [A]  time = 5.72668, size = 157, normalized size = 1.04 \[ \frac{1}{12} \, \sqrt{3}{\left (\sqrt{3}{\left (d - f + g - i\right )} \log \left (x^{2} + x + 1\right ) - \sqrt{3}{\left (d - f - g + i\right )} \log \left (x^{2} - x + 1\right ) + 2 \,{\left (d - 2 \, e + f + g - 2 \, h + i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + 2 \,{\left (d + 2 \, e + f - g - 2 \, h - i\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + 2 \, \sqrt{3}{\left (i x^{2} + 2 \, h x\right )}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 + x^2 + 1),x, algorithm="fricas")

[Out]

1/12*sqrt(3)*(sqrt(3)*(d - f + g - i)*log(x^2 + x + 1) - sqrt(3)*(d - f - g + i)
*log(x^2 - x + 1) + 2*(d - 2*e + f + g - 2*h + i)*arctan(1/3*sqrt(3)*(2*x + 1))
+ 2*(d + 2*e + f - g - 2*h - i)*arctan(1/3*sqrt(3)*(2*x - 1)) + 2*sqrt(3)*(i*x^2
 + 2*h*x))

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4+x**2+1),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.274007, size = 146, normalized size = 0.97 \[ \frac{1}{2} \, i x^{2} + \frac{1}{6} \, \sqrt{3}{\left (d + f + g - 2 \, h + i - 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{1}{6} \, \sqrt{3}{\left (d + f - g - 2 \, h - i + 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + h x + \frac{1}{4} \,{\left (d - f + g - i\right )}{\rm ln}\left (x^{2} + x + 1\right ) - \frac{1}{4} \,{\left (d - f - g + i\right )}{\rm ln}\left (x^{2} - x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((i*x^5 + h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 + x^2 + 1),x, algorithm="giac")

[Out]

1/2*i*x^2 + 1/6*sqrt(3)*(d + f + g - 2*h + i - 2*e)*arctan(1/3*sqrt(3)*(2*x + 1)
) + 1/6*sqrt(3)*(d + f - g - 2*h - i + 2*e)*arctan(1/3*sqrt(3)*(2*x - 1)) + h*x
+ 1/4*(d - f + g - i)*ln(x^2 + x + 1) - 1/4*(d - f - g + i)*ln(x^2 - x + 1)